<include file="Public:header"/>
<script type="text/javascript" src="__WEBPUBLIC__/Admin/js/ajax-operate.js"></script>
<script type="text/javascript" src="__WEBPUBLIC__/Admin/laydate/laydate.js"></script>
<!--主页面-->
<div id="main-content" class="content">
    <ul class="breadcrumb">
        <li class="active">会员列表</li>
    </ul>

    <div class="page-header page-header1 clearfix">
        <h3>会员管理</h3>
        <ul class="nav nav-tabs">
            <li class="active">
                <a href="{:U('Member/memberList')}">会员列表</a>
            </li>
        </ul>
    </div>
    <div class="search-content">
        <button type="submit" class="btn derive">同步粉丝列表</button>
    </div>
    <div class="content-box-table content-box-content">
        <form action="{:U('Member/deleteMember')}" method="post" class="batch-form">
            <table class="table table-striped table-framed table-hover">
                <thead>
                <tr>
                    <th width="8%">
                        <input class="check-all" type="checkbox"/>&nbsp;&nbsp;编号
                    </th>
                    <th width="15%">关注时间</th>
                    <th>昵称</th>
                    <th>头像</th>
                    <th>性别</th>
                    <th>最后关注时间</th>
                    <th>状态</th>

                </tr>
                </thead>
                <tbody class="tbody">
                <if condition="empty($member)">
                    <tr>
                        <td colspan="20"><span style="font-size:14px;">暂无数据</span></td>
                    </tr>
                </if>
                <volist name="member" id="mem">
                    <tr>
                        <td><input type="checkbox" value="{$mem['m_id']}" name="m_id[]"/>&nbsp;&nbsp;{$mem['m_id']}</td>
                        <td>{$mem['ctime']|date='Y-m-d H:i:s',###}</td>
                        <td>{$mem['nick_name']|default="未填写"}</td>
                        <td><img src="{$mem['head_pic']}" style="width:50px"/></td>
                        <td><if condition="$mem['sex'] eq '1'">男<else />女</if></td>
                        <td>{$mem['last_login_time']|date='Y-m-d H:i:s',###}</td>
                        <td>{$mem['status']==8?"中奖":"未中奖"}</td>
                    </tr>
                </volist>
                </tbody>
                <tfoot>
                <tr>
                    <td colspan="20">
                        <div class="bulk-actions fl">
                            <input type="button" class="btn delete-batch" value="批量删除">　
                        </div>
                        <div class="fr">
                            {$page}
                        </div>
                        <if condition="!empty($page)">
                        <div style="padding:24px 10px;float:right;">
                            <span style="font-size: 16px">转到第</span>&nbsp;
                            <input type="tel"  min="1" max="" name="" id="page_num" style="border: 1px solid #ccc;width:50px;height:27px;text-align: center;" value="{:I('get.p')}" placeholder="1"/>&nbsp;
                            <span style="font-size: 16px">页</span>
                            <input type="button" id="go1" value="Go" style="width: 45px;height:30px;border:0;background-color: #c5c5c5;border-radius:1px;color: #ffffff;cursor: pointer"/>
                            <!--<input type="hidden" value="{$_SERVER['REQUEST_URI']}"/>-->
                            <!--<input type="hidden" id="p" value="{:I('get.p')}"/>-->
                        </div>
                        </if>
                    </td>
                </tr>
                </tfoot>
            </table>
        </form>
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function () {
        $("#go1").click(function(){
            var max_page = "{$pages}";
            var go_page = $("#page_num").val();
            if(go_page == 0){
                alert("请输入跳转页数！");
                return false;
            }
            var p_go = 0;
            if(parseInt(go_page)>parseInt(max_page)){
                $("#page_num").val(max_page);
                p_go = max_page;
            }else{
                p_go = go_page;
            }
            var url = "/index.php?s=/Admin/Member/memberList/p/"+p_go;
            var name = "{$request.nickname}";
            if(name){
                url += "/nickname/"+name;
            }
            var start = "{$start_time}";
            if(start){
                url += "/start_time/"+start;
            }
            var end = "{$end_time}";
            if(end){
                url += "/end_time/"+end;
            }
            location.href = url;
        });
    });

    $(".derive").on('click',function(){
        $.ajax({
            url:"{:U('Admin/Wechat/getUserList')}",
            type:"get",
            dataType:"json",
            success:function( res ){

                alert( res.message );
                window.location.reload();
            }
        })
    });
</script>
<include file="Public:footer"/>